package com.system.mapper;

import com.system.anno.State;
import com.system.pojo.administrator;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AdminMapper {
    @Select("SELECT * from administrator where Account=#{account}")
    administrator findByAdminAccount(String account);

    @Insert("insert into administrator(Name,Account,Password) values (#{name},#{account},#{md5String})")
    void add(String name,String account, String md5String);

    @Update("update administrator set Name = #{name} where Administrator_ID=#{id}")
    void update(String name,Integer id);

    @Update("update administrator set Password=#{md5String} where Administrator_ID=#{id}")
    void updatePwd(String md5String, Integer id);
}
